package com.campus.mapper.Impl;

import com.campus.mapper.RoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class RoleMapperImpl implements RoleMapper {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public Integer addUserRole(Long userId, Long roleId) {
        String sql = "insert into t_sys_user_role (user_id,role_id) values (?,?)";
        Object[] args = new Object[]{
                userId,
                roleId
        };
        return jdbcTemplate.update(sql,args);
    }
}
